package com.example.demo.api.controller;

import com.example.demo.api.service.CustomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/demo")
@Slf4j
public class CustomController {

    @Resource
    private CustomService customService;

    @GetMapping("/query")
    public List<Map<String, Object>> query() {
        return customService.query();
    }

    @PostMapping("/add")
    public String add() {
        return customService.add();
    }

    @GetMapping("/create")
    public String create() {
        return customService.create();
    }

}
